package com.aaa.ssm.service.impl;

import com.aaa.ssm.entity.Role;
import com.aaa.ssm.entity.RoleQuery;
import com.aaa.ssm.mapper.RoleMapper;
import com.aaa.ssm.service.RoleService;
import com.aaa.ssm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author AUSU
 * @version 1.0
 * 创建时间：2025/3/25 11:29
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public AjaxResult queryRole(RoleQuery query) {

        List<Role> roles = roleMapper.queryRoleByQuery(query);
        Long totalCount = roleMapper.queryRoleTotalCount(query);

        HashMap<Object,Object> map = new HashMap<>();
        map.put("currentData",roles);
        map.put("totalCount",totalCount);

        return AjaxResult.success(map);
    }
}
